<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
    <title>登录</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <script type="text/javascript" src="/h5/newall/newall.js"></script>
    <script type="text/javascript" src="/h5/js/all2.js"></script>
    <link rel="stylesheet" type="text/css" href="/h5/newall/newall.css">
</head>

<div class="mui-content-padded H5body loadJiguangMsg">
    <MCform id="jobForm"
            class="mctag">
        <MCtitle class="mctag">注册</MCtitle>
        <div class="content">
            <h4 class="h4">欢迎来到</h4>
            <h2 class="h2">美策科技</h2>
            <div class="inputdiv ">
                <div class="mui-input-row">
                    <span class="m86">+86</span>
                    <input type="tel" id="phone" class="mui-input-clear" placeholder="请输入您注册的手机号"/>
                </div>
                <div class="mui-input-row password_div">
                    <input type="password" id="password" class="mui-input-clear"
                           placeholder="设置密码（6-16位数字和字母组合）"/>
                </div>
                <div class="mui-input-row yam_div">
                    <input type="number" id="yam" class="mui-input-clear"
                           placeholder="请输入验证码"/>
                    <a class="codeblue huoquyzm">获取验证码</a>
                    <span style="display: none" class="yanzhengmaTime" mcname="yanzhengmaTime">{{yanzhengmaTime}}s</span>
                </div>

                <label class="zhengcelabel">
                    <input style="
    position: relative;
    top: 2px;
" type="checkbox" name="zhengce" value="tongyi"/>
                    我已阅读并同意 <a class="codeash" href="/h5/ios/userNotice.html">《用户服务协议及隐私政策》</a>
                </label>
                <button class="mui-btn mui-btn-primary mui-btn-block denglubtn resNext">下一步</button>
                <div class="desc clearfix">

                    <p style="text-align: center">已有账号？<a class="codeblue" href="/h5/login/login.html">登录</a></p>
                </div>
            </div>
        </div>
    </MCform>
</div>

</body>
<style>
    .yam_div .yanzhengmaTime{
        position: absolute;
        right: 5px;
        top: 5px;
        color: #7f8c8d;
        font-size: 0.15rem;
    }

    .yam_div .huoquyzm {
        position: absolute;
        right: 5px;
        top: 5px;
    }

    .content {
        margin: 0 auto;
        width: 80%;
        margin-top:0.2rem;
    }

    .m86 {
        position: absolute;
        left: 10px;
        top: 7px;
        font-size: 16px;
        font-family: PingFang-SC-Bold, PingFang-SC;
        font-weight: bold;
        color: rgba(0, 0, 0, 1);
        line-height: 22px;
    }

    #phone {
        padding-left: 50px;
    }

    .inputdiv {
        margin-top: 45px;
    }

    .zhengcelabel .codeash {
        text-decoration: underline;
    }

    .zhengcelabel {
        margin-top: 20px;
        display: block;
    }

    .denglubtn {
        margin-top: 20px;
    }

    .desc .codeblue {
        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
    }
    mcform .mui-input-row{
        border: 0;
    }
</style>
<script>
    var view = new MC.View.MCform('#jobForm');
    view.vue.yanzhengmaTime=30;
    var yanTime=0;
    $('.huoquyzm').on('click', function () {
        var phone = $('#phone').val();
        if (!MC.test.regMobile(phone)) {
            return;
        }
        MC.apiD("/api/member/yzm", {
            phone: phone
        },function(d){
            console.log(d);
            view.vue.yanzhengmaTime=60;
            if(d!=='ok') MC.msg.alert(d);
            $('.huoquyzm').hide();
            $('.yanzhengmaTime').show();
            if(yanTime!=0){
                clearInterval(yanTime);
                yanTime=0;
            }
            yanTime=setInterval(function () {
                if(view.vue.yanzhengmaTime==0){
                    clearInterval(yanTime);
                    yanTime=0;
                    $('.huoquyzm').show();
                    $('.yanzhengmaTime').hide();
                    return;
                }
                view.vue.yanzhengmaTime--;
            },1000);
        });
    });
    $('.resNext').on('click', function () {
        var phone = $('#phone').val();
        var yzm = $('#yam').val();
        var password = $('#password').val();
        if (!MC.test.regMobile(phone)) {
            return;
        }
        if (!MC.test.regPwd(password)) {
            return;
        }
        if (yzm == '') {
            MC.msg.alert("验证码必须输入");
            return;
        }
        if(!$("[name=zhengce]").is(":checked")){
            MC.msg.alert("必须勾选我已阅读并同意");
            return;
        }
        MC.apiD("/api/member/regist", {
            phone: phone,
            yzm: yzm,
            pwd: password
        }, function (data) {
            window.open('/h5/login/indentity.html?type=regist',"_self");
        });
    });
</script>
</body>
</html>